<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="afragment::head(~{::title})">
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>反馈管理</title>
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css" >
	<link rel="stylesheet" href="../../static/css/me.css" >
	<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">

</head>
<body>
	<!-- 导航 -->
	<nav th:replace="afragment::menu(4)" class="ui inverted attached segment m-padded-tb-mini">
	 <div class="ui container">
		 <div class="ui inverted secondary stackable menu">
			<h2 class="ui teal header item">后台管理</h2>
			<a href="UserManage.html" class="item"><i class="mini user icon"></i>用户管理</a>
			<a href="PostManage.html" class="item"><i class="mini file icon"></i>启事管理</a>
			<a href="NoticeManage.html" class="item"><i class="mini bell icon"></i>公告管理</a>
			<a href="FeedbackManage.html" class="item"><i class="mini envelope icon"></i>反馈管理</a>
			<a href="../static/index.html" class="item"><i class="mini home icon"></i>进入主页</a>
			<div class="right m-item  menu">
			  <div class="ui dropdown  item">
			    <div class="text" id="loginA">
			      <img  class="ui avatar image" src="../static/images/HeadSculpture.jpg">
			      Moon
			    </div>
			    <i class="dropdown icon"></i>
			    <div class="menu">
			      <a href="#" class="item">注销</a>
			    </div>
			  </div>
			</div>
		 </div>
	 </div>
	</nav>
	
	<!-- 中间内容 -->
	<div  class="m-container-small m-padded-tb-big">
	  <div class="ui container">
	    <form th:action="@{/admin/searchFeedback}" th:method="get" class="ui segment form">
	      <div class="inline fields">
				
	        <div class="field" style="margin-top: 1em;">
	          <input type="text" name="search" placeholder="输入查询内容">
	        </div>
	        <div class="field" style="margin-top: 1em;">
	          <button class="ui mini teal basic button"><i class="search icon"></i>搜索</button>
	        </div>
	      </div>
	    </form>
	
	    <table class="ui celled table">
	      <thead>
	        <tr>
	          <th>反馈id</th>
	          <th>反馈者</th>
              <th>标题</th>
	          <th>内容</th><!-- 启事的标题 -->
	          <th>创建时间</th>
	          <th>操作</th>
	        </tr>
	      </thead>
	      <tbody>
	        <tr th:each="feedback:${feedbacks}">
	          <td th:text="${feedback.id}">1</td>
	          <td th:text="${feedback.uname}">Moon</td>
              <td th:text="${feedback.title}">申请管理</td>
	          <td th:text="${feedback.content}">我想申请当系统的管理员</td>
	          <td th:text="${#dates.format(feedback.ctime,('yyyy-MM-dd HH:mm:ss'))}">2025-6-10 09:45</td>
	          <td>
				<button th:onclick="'Values('+${feedback.id}+')'" class="ui mini teal basic button" data-toggle="modal" data-target="#myModal1">回复</button>
	            <button th:onclick="'deleteFeedback('+${feedback.id}+')'" class="ui mini red basic button">删除</button>
	          </td>
	        </tr>
	      </tbody>
	      <tfoot>
            <tr>
                <th colspan="7">
                    <div th:if="${pageInfo}!=null" class="ui mini pagination menu">
<!--                        <a class=" item">上一页</a>-->
<!--                        <a class=" item">下一页</a>-->
                        <label>总共[[${pageInfo.pages}]]页，当前第[[${pageInfo.pageNum}]]页</label>
                        <div class="column">
                            <a th:if="${pageInfo.prePage}!=0" th:href="${#request.getRequestURL()}+'?page='+${pageInfo.prePage}" class="ui teal basic button">上一页</a>
                        </div>
                        <div class="right aligned column">
                            <a th:if="${pageInfo.nextPage} <= ${pageInfo.pages}" th:href="${#request.getRequestURL()}+'?page='+${pageInfo.nextPage}" class="ui teal basic button">下一页</a>
                        </div>
                    </div>
                </th>
            </tr>
	      </tfoot>
	    </table>
	  </div>
	</div>
	
	<!-- 回复模态框 -->
	<form class="modal fade" id="myModal1" th:action="@{/admin/reply}" th:method="post">
	  <div class="modal-dialog">
	    <div class="modal-content">
	 
	      <!-- 模态框头部 -->
	      <div class="modal-header">
	        <i class="large comment icon"></i>回复
	        <button type="button" class="close" data-dismiss="modal">&times;</button>
	      </div>
	 
	      <!-- 模态框主体 -->
	      <div class="modal-body">
              <input type="hidden" name="feedbackId" id="feedbackId">
              <div class="extra content">
                  <label class="m-text-thin ">回复内容:</label>
                  <div class="ui input focus" style="vertical-align:middle;margin-top: 10px;">
	               <textarea name="content" rows="6" placeholder="输入回复的内容，通过email发送到反馈者邮箱..."  style="width: 300px;"
                             class="tweet-textarea disabled-resize"></textarea>
                  </div>
              </div>
	      </div>
	 
	      <!-- 模态框底部 -->
	    <div class="modal-footer">
	        <input type="submit" onclick="myFunction1()" class="btn btn-success" value="发送">
		</div>
	 
	    </div>
	  </div>
	</form>

	<!-- 底部footer -->
	<footer th:replace="afragment::footer" class="ui inverted vertical segment m-padded-tb-massive ">
		<div class="ui center aligned container">
			<div class="ui inverted divided grid">
				<div class="three wide column">
					<div class="ui inverted link list">
						<div class="item">
							<img src="../static/images/DLMU.svg" class="ui rounded image" alt="" style="width: 110px;">
						</div>
					</div>
				</div>
				<div class="three wide column">
					<h4 class="ui inverted header m-text-thin m-text-spaced ">常见问题</h4>
					<div class="ui inverted link list">
						<a href="../problems.html" class="item">点击查看</a>
						<a href="../feedback.html" class="item" >点击反馈</a>
					</div>
				</div>
				<div class="three wide column">
					<h4 class="ui inverted header m-text-thin m-text-spaced ">如何联系</h4>
					<div class="ui inverted link list">
						<a href="#" class="item m-text-thin">Email：xxxxxxxx@qq.com</a>
						<a href="#" class="item m-text-thin">QQ：xxxxxxxx</a>
					</div>
				</div>
				<div class="seven wide column">
					<h4 class="ui inverted header m-text-thin m-text-spaced ">关于我们</h4>
					<p class="m-text-thin m-text-spaced m-opacity-mini">LostFound</p>
				</div>
			</div>
			<div class="ui inverted section divider"></div>
			<p class="m-text-thin m-text-spaced m-opacity-tiny">Copyright © 2025 - 3000 LostFound Designed by DLMU-LZT</p>
		</div>
	</footer>


    <script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
    <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
    <script src="https://cdn.bootcss.com/semantic-ui/2.3.1/semantic.js"></script>
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>

<script>
   

    $('.ui.dropdown').dropdown({
      on : 'hover'
    });
	
	function myFunction1(){
		alert("回复成功！");
	}

    function deleteFeedback(feedbackId) {
        $.ajax({
            url: "deleteFeedback/"+feedbackId,
            type: "delete",
            async: true,
            success: function () {
                alert("删除成功!");
                location.reload();
            },
            error: function (error) {
                console.error(error);
            }
        });
    }
    function Values(id) {
        $('#feedbackId').val(id);
    }
  </script>
</body>
</html>
